package com.zhidian.edm.exception;


/**
 * 自定义业务异常
 */

public class BusinessException extends RuntimeException {

    private final int code;

    public BusinessException(int code, String message) {
        super(message); // 调用父类构造器
        this.code = code;
    }

    public BusinessException(String message) {
        this(500, message); // 默认 code 500
    }

    public int getCode() {
        return code;
    }
}
